package com.chatplus.application.service.file;

import com.baomidou.mybatisplus.extension.service.IService;
import com.chatplus.application.domain.entity.file.SysOssEntity;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.List;

/**
 * OSS对象存储表业务逻辑接口
 *
 * <p>Table: t_sys_oss - OSS对象存储表</p>
 *
 * @author developer
 * @see SysOssEntity
 */
public interface SysOssService extends IService<SysOssEntity> {

    List<SysOssEntity> getByUrls(List<String> urlList);

    SysOssEntity getByOssIdOfMatchingUrl(Long ossId);

    SysOssEntity upload(MultipartFile file);

    SysOssEntity upload(File file, String configKey);

    SysOssEntity upload(MultipartFile file, String configKey);

    SysOssEntity upload(MultipartFile file, String configKey, String hashId);

    SysOssEntity upload(String customFileName, MultipartFile file, String configKey);

    void download(Long ossId, String fileName, HttpServletResponse response) throws IOException;

    SysOssEntity upload(File file);

    void download(Long ossId, HttpServletResponse response) throws IOException;

    Boolean deleteByIds(Collection<Long> ids);

    InputStream getFileInputStream(Long ossId);

    SysOssEntity getByHashId(String hashId);
}
